home *** CD-ROM | disk | FTP | other *** search
/ The Whitby AMOS Club / Whitby AMOS Club 1.adf / TEXT / BEGINNERS < prev    next >
Text File  |  1978-01-29  |  4KB  |  91 lines

  1.                   Whitby Amos Club Beginners Section
  2.                   ----------------------------------
  3.  
  4.      Welcome to the very first programming tutorial for beginners
  5.      brought to you by the Whitby Amos Club. So come on and settle
  6.      back and enjoy the exciting world of AMOS basic.
  7.      First of all, congratulations for buying one of the greatest
  8.      programming tools available for the Amiga. Amos's principle is
  9.      to let you access the Amigas hardware and technical wizardry
  10.      quickly and easily without having to wade through assembler.
  11.  
  12.      Well lets not bother with assembler shall we. lets
  13.      concentrate on AMOS and programming in general. A computer
  14.      program is simply a collection of instructions telling a
  15.      computer what to do. We can store our programs on disk, or if
  16.      were lucky a hard drive. We can use a keyboard to 'INPUT' our
  17.      programs our we can 'LOAD' them from disk.
  18.  
  19.      Lets start with our first program shall we.
  20.      Load up your copy of AMOS. When it is loaded press any key to
  21.      get rid of the intro menu. You are now into the editor. This
  22.      is where you will enter most of your programs.
  23.      now enter the following:
  24.  
  25.      PRINT "HELLO READER"
  26.  
  27.      TO GET ", PRESS SHIFT+2
  28.  
  29.      All this simple program does is prints what ever you place
  30.      inside the two dots or quotation marks. So on the screen will
  31.      be displayed "HELLO READER". You can place numbers as well as
  32.      letters inside your quotes. Your not restricted. If you want to
  33.      do a simple maths program that adds to numbers together then
  34.      why not try this program for size.
  35.  
  36.      INPUT "ENTER YOUR FIRST NUMBER",NONE
  37.      INPUT "ENTER YOUR SECOND NUMBER",NTWO
  38.      LET THREE=NONE+NTWO
  39.      PRINT NONE+NTWO=THREE
  40.  
  41.      In this program we introduce the talents of 'VARIABLES'.
  42.      Variables are simply places inside a computers memory that you
  43.      can store data. For example: In our program we use a variable
  44.      called 'NONE'. All this tells the computer to do is store your
  45.      replay to the question been asked by the program. Let say you
  46.      answered 15 for the first question, then the number 15 would be
  47.      placed inside the computers memory under the address 'NONE'.
  48.  
  49.      Just think of computer memory addresses as real home addresses.
  50.      Its somewhere for them to live. The same principle applies for
  51.      the second question. Again, the answer you give is stored in an
  52.      address called 'NTWO'. Finally the last statement adds the two
  53.      numbers together to give you your answer. So if you entered 15
  54.      for the first question and 15 for the second then 30 would be
  55.      displayed as our program suggests. Have you noticed that i
  56.      have not used quotations for the last statement in our program?
  57.  
  58.      That is we don't need to use quotation marks if we are adding two
  59.      variables together. Going back to the program i almost forgot
  60.      to tell you about the word 'INPUT'. As the word suggests, you
  61.      simply 'INPUT' or enter the required response. I thought you
  62.      may have gathered that but, just in case, i thought i'd  mention
  63.      it. That covers adding numbers together. lets add two 'STRING
  64.      VARIABLES' together shall we.
  65.      String variables are simply a string that enables you to store
  66.      text. eg:
  67.  
  68.      A$="WHITBY AMOS CLUB"
  69.  
  70.      So basically we have asked the computer to store our text into a
  71.      memory address called 'A$'. The address rule applies as above
  72.      except this time we have asked the computer to store a pre-set
  73.      response. Being 'WHITBY AMOS CLUB' into our address storage.
  74.      We have also used a '$' this time as our 'variable' name. This
  75.      tells the Amiga that we would like to store text into its
  76.      memory. You don't need the '$' if you want to store numbers.
  77.      For a bit of a fun exercise, why not write a program that will ask
  78.      a user for the following and display them on the screen in a nice
  79.      address book fashion:
  80.  
  81.                NAME, ADDRESS,AGE,TELEPHONE NUMBER
  82.  
  83.      Next time i will display a solution to the above question.
  84.      In the coming issues i will show you how to program your very
  85.      own database. It not as hard as it sounds. All the examples
  86.      above are contained on the disk so you can see for yourselves.
  87.      Sadly thats it for this issue. So hope to see you next issue.
  88.      So until then, happy AMOSing.
  89.  
  90.      (PAUL GUMSLEY)
  91.